﻿using TracedReality.Primitive;

namespace TracedReality.RayTracing
{
    /// <summary>
    /// A structure to pass around containing information about
    /// where a Ray hit something.
    /// </summary>
    public class Hit
    {
        /// <summary>
        /// The distance along the Ray that this hit occurred.
        /// </summary>
        public double t;

        /// <summary>
        /// The Material of the object that the Ray hit.
        /// </summary>
        public Material material;

        /// <summary>
        /// The normal of the object at the point the Ray hit.
        /// </summary>
        public Vector normal;

        /// <summary>
        /// Create a new Hit that is infinitely far along a Ray.
        /// </summary>
        public Hit()
        {
            t = double.PositiveInfinity;
            material = null;
            normal = new Vector();
        }
    }
}
